Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependency pytest-httpx to ^0.34.0 #97

Merged
merged 1 commit into from
Nov 19, 2024
Merged

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Sep 20, 2024

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
pytest-httpx (changelog) ^0.30.0 -> ^0.34.0 age adoption passing confidence

Release Notes

Colin-b/pytest_httpx (pytest-httpx)

v0.34.0

Compare Source

Added
  • is_optional parameter is now available on responses and callbacks registration. Allowing to add optional responses while keeping other responses as mandatory. Refer to documentation for more details.
  • is_reusable parameter is now available on responses and callbacks registration. Allowing to add multi-match responses while keeping other responses as single-match. Refer to documentation for more details.
Fixed
  • httpx_mock.get_request will now also propose to refine filters if more than one request is found instead of only proposing to switch to httpx_mock.get_requests.

v0.33.0

Compare Source

Added
  • Explicit support for python 3.13.
  • should_mock option (callable returning a boolean) is now available, defaulting to always returning True. Refer to documentation for more details.
  • Matching on the full multipart body can now be performed using match_files and match_data parameters. Refer to documentation for more details.
  • Matching on extensions (including timeout) can now be performed using match_extensions parameter. Refer to documentation for more details.
Removed
  • non_mocked_hosts option is not available anymore. Use should_mock instead as in the following sample:
    import pytest
    
    @​pytest.mark.httpx_mock(non_mocked_hosts=["my_local_test_host"])
    def test_previous_behavior(httpx_mock):
        ...
    
    @​pytest.mark.httpx_mock(should_mock=lambda request: request.url.host not in ["my_local_test_host"])
    def test_new_behavior(httpx_mock):
        ...
    Please note that your hosts might need to be prefixed with www. depending on your usage.

v0.32.0

Compare Source

Added
  • The following option is now available:
    • can_send_already_matched_responses (boolean), defaulting to False.
  • Assertion failure message in case of unmatched responses is now linking documentation on how to deactivate the check.
  • Assertion failure message in case of unmatched requests is now linking documentation on how to deactivate the check.
  • httpx.TimeoutException message issued in case of unmatched request is now linking documentation on how to reuse responses (in case some responses are already matched).
Fixed
  • Documentation now clearly state the risks associated with changing the default options.
  • Assertion failure message in case of unmatched requests at teardown is now describing requests in a more user-friendly way.
  • Assertion failure message in case of unmatched requests at teardown is now prefixing requests with - to highlight the fact that this is a list, preventing misapprehension in case only one element exists.
  • Assertion failure message in case of unmatched responses at teardown is now prefixing responses with - to highlight the fact that this is a list, preventing misapprehension in case only one element exists.
  • httpx.TimeoutException message issued in case of unmatched request is now prefixing available responses with - to highlight the fact that this is a list, preventing misapprehension in case only one element exists.
  • httpx.TimeoutException message issued in case of unmatched request is now listing unmatched responses (in registration order) before already matched one (still in registration order).
    • The incentive behind this change is to help identify a potential mismatch faster as the first unmatched response is the most likely to be the one expected to match.
  • Response description in failure messages (httpx.TimeoutException message issued in case of unmatched request or assertion failure message in case of unmatched responses at teardown) is now displaying if the response was already matched or not and less misleading in it's phrasing about what it can match (a single request by default).
Changed
  • Last registered matching response will not be reused by default anymore in case all matching responses have already been sent.
    • This behavior can be changed thanks to the new pytest.mark.httpx_mock(can_send_already_matched_responses=True) option.
    • The incentive behind this change is to spot regression if a request was issued more than the expected number of times.
  • HTTPXMock class was only exposed for type hinting purpose. This is now explained in the class docstring.
    • As a result this is the last time a change to __init__ signature will be documented and considered a breaking change.
    • Future changes will not be documented and will be considered as internal refactoring not worth a version bump.
    • __init__ now expects one parameter, the newly introduced (since [0.31.0]) options.
  • HTTPXMockOptions class was never intended to be exposed and is now marked as private.

v0.31.2

Compare Source

Fixed
  • httpx_mock marker can now be defined at different levels for a single test.

v0.31.1

Compare Source

Fixed
  • It is now possible to match on content provided as async iterable by the client.

v0.31.0

Compare Source

Changed
  • Tests will now fail at teardown by default if some requests were issued but were not matched.
    • This behavior can be changed thanks to the new pytest.mark.httpx_mock(assert_all_requests_were_expected=False) option.
    • The incentive behind this change is to spot unexpected requests in case code is swallowing httpx.TimeoutException.
  • The httpx_mock fixture is now configured using a marker (many thanks to Frazer McLean).

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot changed the title Update dependency pytest-httpx to ^0.31.0 Update dependency pytest-httpx to ^0.32.0 Sep 27, 2024
@renovate renovate bot force-pushed the renovate/pytest-httpx-0.x branch from 42f5c57 to 40d630b Compare September 27, 2024 15:42
@renovate renovate bot force-pushed the renovate/pytest-httpx-0.x branch from 40d630b to 733d0ec Compare October 28, 2024 21:54
@renovate renovate bot changed the title Update dependency pytest-httpx to ^0.32.0 Update dependency pytest-httpx to ^0.33.0 Oct 28, 2024
@renovate renovate bot changed the title Update dependency pytest-httpx to ^0.33.0 Update dependency pytest-httpx to ^0.34.0 Nov 18, 2024
@renovate renovate bot force-pushed the renovate/pytest-httpx-0.x branch 2 times, most recently from ddd9f1a to 49e8cd9 Compare November 19, 2024 15:40
@renovate renovate bot force-pushed the renovate/pytest-httpx-0.x branch from 49e8cd9 to e34e9a6 Compare November 19, 2024 15:42
@major major merged commit 262367f into main Nov 19, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant